<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;


class Image extends Model{
    protected $table = 'images';

    /**
     * 通过类型字段查询多条记录
     * @param $type
     * @return mixed
     */
    public function getInfoListByType($type){
        return $this->where('type',"=",$type)->get();
    }



    /**
     * 通过类型字段查询单条记录
     * @param $type
     * @return mixed
     */
    public function getInfoByType($type){
        return $this->where('type',"=",$type)->first();
    }
}
